package com.xiaoma.controller;

import com.xiaoma.ioc.demo.AbstractTestImpl2;
import com.xiaoma.mvcconfig.SessionHolder;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

/**
 *
 * @author 程序猿DD
 * @version 1.0.0
 * @blog http://blog.didispace.com
 *
 */
@RestController
public class TestController {

//    @Autowired
//    private MyCore myCore;

//    @Autowired
    private AbstractTestImpl2 testImpl2;

    public TestController(AbstractTestImpl2 testImpl2) {
        this.testImpl2 = testImpl2;
    }

//    @Autowired
//    private ConfigurationPropertiesTest test;

    @RequestMapping(path = "/api/test", method = {RequestMethod.GET, RequestMethod.POST})
    public String hello(String order) throws InterruptedException {
        testImpl2.test();
        HttpSession currentSession = SessionHolder.getCurrentSession();
        return "success...";
    }

}